<extend name="Public/base"/>
<block name="body">

    <script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
    <![endif]-->
    <!--[if gte IE 9]><!-->
    <script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
    <!--<![endif]-->

    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>添加推送</h2>
    </div>
    <form action="{:U('message_add')}" method="post" class="form-horizontal">

        <div class="form-item">
            <label class="item-label">标题<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="title" value="{$info.title}">
            </div>
        </div>



        <div class="form-item">
            <label class="item-label">发送用户<span class="check-tips"></span></label>
            <div class="controls">
                <input type="radio" class="type"  name="type_url"  <if condition="$info.uid eq 0">checked="checked"<else/></if> value="1">全部 &nbsp;&nbsp;
                <input type="radio" class="type"  name="type_url"  <if condition="$info.uid gt 0">checked="checked"<else/></if> value="2">个人 &nbsp;&nbsp;
            </div>
        </div>

        <div class="form-item uid"  style="display: none">
            <label class="item-label">发送用户（uid）</label>
            <div class="controls">
                <input type="text" class="text input-large" name="uid" value="{$info.uid}">
            </div>
        </div>

        <!--<div class="form-item cf">-->
            <!--<label class="item-label">消息内容<span class="check-tips"></span></label>-->
            <!--<div class="controls">-->
                <!--<label class="textarea input-large"><textarea name="content">{$info.content}</textarea></label>-->
            <!--</div>-->
        <!--</div>-->

        <div class="form-item">
            <label class="item-label">消息内容<span class="check-tips"></span></label>
            <label class="textarea">
                <textarea name="content">{$info.content}</textarea>
                {:hook('adminArticleEdit')}
            </label>
        </div>


        <input type="hidden" class="text input-large id" name="id" value="{$info.id}">
        <div class="form-item">
            <empty name="info.id">
            <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            </empty>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        var val=$('input:radio[name="type_url"]:checked').val();
        if(val==2){
            $('.uid').attr("style","display:block");
        }
        //导航高亮
        highlight_subnav("{:U('Manage/message')}");
        $(".type").click(function () {
            var val=$('input:radio[name="type_url"]:checked').val();
            var id=$('.id').val();
                if(val==2){
                    $('.uid').attr("style","display:block");
                }else{
                    $('.uid').attr("style","display:none");
                }
        });
    </script>
</block>
